import request from '@/config/axios'

// 生活补贴规则 VO
export interface RulesLivingVO {
  id: number // 主键ID
  seqId: number // 序列ID
  posId: number // 岗位ID
  amount: number // 补贴金额
}

// 生活补贴规则 API
export const RulesLivingApi = {
  // 查询生活补贴规则分页
  getRulesLivingPage: async (params: any) => {
    return await request.get({ url: `/pm/rules-living/page`, params })
  },

  // 查询生活补贴规则详情
  getRulesLiving: async (id: number) => {
    return await request.get({ url: `/pm/rules-living/get?id=` + id })
  },

  // 新增生活补贴规则
  createRulesLiving: async (data: RulesLivingVO) => {
    return await request.post({ url: `/pm/rules-living/create`, data })
  },

  // 修改生活补贴规则
  updateRulesLiving: async (data: RulesLivingVO) => {
    return await request.put({ url: `/pm/rules-living/update`, data })
  },

  // 删除生活补贴规则
  deleteRulesLiving: async (id: number) => {
    return await request.delete({ url: `/pm/rules-living/delete?id=` + id })
  },

  // 导出生活补贴规则 Excel
  exportRulesLiving: async (params) => {
    return await request.download({ url: `/pm/rules-living/export-excel`, params })
  },
}